package query

import (
	"fmt"
	"os/exec"
)

// runCommand 执行命令行命令
func runCommand(name string, args ...string) (string, error) {
	cmd := exec.Command(name, args...)
	output, err := cmd.CombinedOutput()
	if err != nil {
		return "", fmt.Errorf("命令执行失败: %s, 错误: %v", string(output), err)
	}
	return string(output), nil
}

// MemoryInfo 存储内存信息
type MemoryInfo struct {
	Used  int
	Total int
}
